<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- <img src="" alt="" title=""> -->
     <!-- 自定义属性 -->
     <div data-id="1" data-spm="未知">1</div>
     <div data-id="2">2</div>
     <div data-id="3">3</div>
     <div data-id="4">4</div>
     <div data-id="5">5</div>
     <script>
        const one = document.querySelector('div')
        console.log(one.dataset)
        console.log(one.dataset.id)
        console.log(one.dataset.spm)


        
     </script>
</body>
</html>